//
//  EVEAPICharacter.m
//  EVE Mac Suite
//
//  Created by Vadim Lozko on 3/29/09.
//  Copyright 2009 __Vadim__CompanyName__. All rights reserved.
//

#import "EVEAPICharacter.h"
#import "EVEAPICoreDataController.h"

@implementation EVEAPICharacter

-(id)initWithCharacterInfo:(NSDictionary*)charInfo
{
	if(self = [super init])
	{
		initialCharacterInfo = [charInfo retain];
	}
	return self;
}

-(NSString*)charName
{
	return [initialCharacterInfo objectForKey:CHAR_INFO_DICT_NAME];
}

-(NSString*)xmlStorePath
{
	return [[EMSGeneralUtils applicationSupportFolder] stringByAppendingPathComponent:[initialCharacterInfo objectForKey:CHAR_INFO_DICT_NAME]];
}

-(NSDictionary*)downloaderInfo
{
	return initialCharacterInfo;
}

-(void)updateDidFinish:(NSNumber*)success 
{
	NSDictionary* userInfoDict = [NSDictionary dictionaryWithObjectsAndKeys:[self charName], CHAR_INFO_DICT_NAME, 
								  success, NOTIFICATION_SUCCESS_UPDATE_KEY, nil];
	[[NSNotificationCenter defaultCenter] postNotificationName:[self APIDocumentType] object:nil userInfo:userInfoDict];
}


@end
